package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 账户相关接口
 *
 * @author itcast
 * @create 2023/9/11 16:14
 **/
@RestController("workerBankAccountController")
@RequestMapping("/worker/bank-account")
@Api(tags = "服务人员端 - 账户相关接口")
public class BackAccountController {
    @Autowired
    private IBankAccountService bankAccountService;

    @PostMapping
    private BankAccountResDTO saveOrUpdate(@RequestBody BankAccountUpsertReqDTO bankAccountUpsertReqDTO){
        return bankAccountService.saveOrUpdate(bankAccountUpsertReqDTO);
    }

    @GetMapping("/currentUserBankAccount")
    private BankAccountResDTO currentUserBankAccount(){
        return bankAccountService.currentUserBankAccount();
    }
}
